<?php
class Migration_Create_Visitas_Lotes extends CI_Migration {
	
	private $table = 'visitas_lotes';
	
	public function up() {
		$obj = $this->dbforge;
		$fields = array (
				'VISITA_ID' => array (
						'type' => 'int',
						'unsigned' => true,
						'auto_increment' => true,
						'null' => false,
						'constraint' => 11 
				),
				'LOTE_ID' => array (
						'type' => 'INT',
						'constraint' => 11,
						'null' => false 
				),
				'COUNT' => array (
						'type' => 'INT',
						'constraint' => '11',
						'null' => false,
						'default' => '0'
				)
				
		);
		$obj->add_key ('VISITA_ID', true );
		$obj->add_field ( $fields );
		$obj->create_table ( $this->table, TRUE );
		
		
		
	}
	public function down() {
		$this->dbforge->drop_table ($this->table);
	}
}
